const nodemailer = require("nodemailer");
const schedule = require("node-schedule");
const transporter = nodemailer.createTransport({
    host: "smtp.qq.com",
    port: 465,
    secure: true,
    auth: {
        user: "927518044@qq.com",
        pass: "bgauqpdeorrxbfji"
    }
})

const mailOptions = {
    from: "927518044@qq.com",
    to: "360079011@qq.com",
    subject: "测试标题",
    text: "测试邮件"
}
const task = transporter.sendMail(mailOptions, function (err, data) {
    if (err) {
        console.log(err);
    } else {
        console.log(`发送成功：【${new Date()}】`, data.accepted);
    }
});
schedule.scheduleJob('*/5 * * * *', () => task);
